package cn.jobstart.enums;

/**
*    @author xy
*    @Date 2024-01-08 10:22:55
*    @description 消息类型
*/
import cn.jobstart.pubInter.EnumVO;
import java.util.ArrayList;
import java.util.List;

public enum DouyinMessageTypeEnum {

    COMMENT(0, "评论") ,
    SECRET_TALK(1, "私聊") ,
    REPLY(2, "回复评论") ; 




    private Integer type;
    private String desc;

    DouyinMessageTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByType(Integer type) {
        if(type==null ){
            type=0;
        }
        for (DouyinMessageTypeEnum var : DouyinMessageTypeEnum.values()) {
            if (type==var.getType().intValue())
                return var.getDesc();
             }
        return DouyinMessageTypeEnum.values()[0].getDesc();
    }

    public static List<EnumVO> getDescs() {
        List list = new ArrayList();

        for (DouyinMessageTypeEnum var : DouyinMessageTypeEnum.values()) {
            EnumVO enumVO = new EnumVO();
            enumVO.setId(var.getType()+"");
            enumVO.setName(var.getDesc());
            list.add(enumVO);
        }


        return list;
    }

}
